import 'package:flutter/material.dart';

class ButtonDemo extends StatelessWidget {
  const ButtonDemo({
    Key key,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.start,
      children: [
        ElevatedButton(onPressed: (){
          print("click");
        }, child: Text("elevatedButton")),
        TextButton(onPressed: (){
          print("click");
        }, child: Text("textButton")),
        OutlinedButton(onPressed: (){
          print("click");
        }, child: Text("outlineButton")),
        TextButton(onPressed: (){}, style:ButtonStyle(
          shape: MaterialStateProperty.all(RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(8)
          )),
          backgroundColor: MaterialStateProperty.all(
              Colors.amber
          ),
          textStyle: MaterialStateProperty.all(TextStyle(
              color: Colors.white
          )),
        ),child: Row(
          mainAxisSize: MainAxisSize.min,
          children: [
            Icon(Icons.favorite,color: Colors.red),
            Text("喜欢作者")
          ],
        ))
      ],
    );
  }
}